package com.woniuxy.configuration;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118644524";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDMakx2I+csdbHtX1v02XzFrI3veBpAYfKrL6Fp2AwNg6492gDXm0zLKR/qmQcKXklXUOlb6sQVlxYvuviKJYgea+qw6p4CRfgAsa7zSeRiZhFnAXU44y8FoNNwHp2bJY7xMjILN6WRgqa8f6kEgXrhwU2FmBKIkaZWJ8UGb7jIuxeJac2Fx+8DiT8OCW3TIHEoH/QeW3mC3tF94AkZFU1GUuYGkxF3FEBKuJHq/hnqxwtiydTTPwD2N7jTMi1u57163jWndNeIp30gmLnBmjWEZiENg3cC3HgSKAE9Pw4tTuY6M3qwxgj+RsrEVXA6npeau3VNK5IzjvQNMxeryOb/AgMBAAECggEATpUGs9v1gMf2EJS6GxSIvM0q+0YmgV2mFl0HJlNhvshCcZCfBkOzb95tYJhXdorskt6N90H3A33Dj7HG3gSzoU5HOJ/ZAnK3djzYTrq3S4SFaB3NXIMpjnZXEiES4ZO8schkKJ/JzHh3dLt21D6aaLMRBCyD43Bqi3Bac7D7Tl6+CT7Sb2Y0c/XeeNG6agIoak0b3IezTAXwhIp1TdzYmu2APacRLlXizX6zUQslonT5+YqZtQQnBO7m4IRTGNpp7rX3CBYoijkLQ/Od+L84nP0BzMjccSfcbDurPbCxTOBC/h38hEx2boytAWYRvcLapRtBuOGa+oEd8xgAvM6OkQKBgQDvmsOBc2IQyQ1SoNLN27VLw7LTtMEPQj37Ztq6k8ieLsRgNB22ajWYoVRLLv9GiD9S799JphsJC4RZ471knd8z1fVA7fBIX4JC+FJiFuMOfmUTUnZLfVOn8H88GlQIo+LQRgk2MjfkZhOzALso5W1AXQCNtRiweM/AcV7lpbdjwwKBgQDaZxyJGPSdCGga2yes6hoD4EundTYv7iXXGeWGM1aTfyNuw9AlsKLlU2nBTP2EqQrV6TTZgJsJUm0t9uwuju4Mu13+pDU8I+gP8BMcV6Vlsf7fAwa8VpEHCpevMeA9oXfK8Lh/M9xgWiTz+cqSuvDAnNbmfseB/XGWDDtkzQfoFQKBgChp5Dv7aDkIkFS1h5jtTAEBezI2NLIMLEQxLwd1UctMfBb182UHOQ8LdxpPTQNqi7PDfdgASmMWLDa1MQa9kh4+ImXXPEYYxfHhzJN65MVXEFlX+Vf2RZv39p3+mtnyOpmClp8rjT3a8cupfegB+pF2nldIimeJmREOjkER2ILdAoGAC5IK4PiBfRBE86dIotCEMFBhsa10AXYMayjkEAgIPiguKGAXVufUuXGB2MvLYovSFyMTubImhIfpYNYEDTNlSSdkA2mPqG/+i1mcqZO7H3gemJIAeVnctRLKlm1+A8XaItY97/8/XZto+cPyB3P/7TRh7jQpPam/qsNbIiv6j0ECgYAgxxcJCzIu5TFt7E0QCfuC00fwaXxqNHxC6FOUr7WFIAUf2Bl5Pi7fzyZ7Zr0TXyVZEJ5uJd0ZBPQUK2OBWUr7ELi6ShRxfba93RZwmfCKagNsC1ol1cjg+aEHUh0SxCMtzWa+DNeQxnqzT9GDYiraYQugW0wvV3caBoucnJxK4w==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkgcTu1+ikhabQFXOx9uwmM5GMsqTx41qkrIViEOESdTUAcoywAgk466qOG5gp4fudlxpvnL9agvAL8RXRmWxhHAG/MK9MilWXP+HH899voRE6y6Q6aBBkCi1CfwrSlf3XDCnJWZcWDjm1/j8Bo1T70STYHyPk+IxYBT41lRxZDZzkTdzjtgYHiEkdfMRtBUJ3/DuXG1aAqf1vWcnI8rkFHzU3tj8u82NVjRrtZ+VT6DIY83GZ1+r63ug1TvS8wRrcqPqW555KLmAReOCVJVuXkNHtVvnsz3OFvEREpypxYjULt+3l9MlClOruXuYKXtW6PC0dNcPGgeHbyaqoRGSAwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://nanshang.free.vipnps.vip/alipay/notify_url";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://nanshang.free.vipnps.vip/alipay/return_url";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

